package com.ruitu.mall_98.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;

import com.beanu.arad.base.my_base.MyBaseActivity;
import com.beanu.arad.utils.ToastUtils;
import com.beanu.arad.widget.progressactivity.ProgressLayout;
import com.ruitu.mall_98.R;

import java.util.HashMap;
import java.util.Map;

import io.rong.imkit.RongIM;
import io.rong.imlib.model.Conversation;

public class MsgActivity extends MyBaseActivity {
    private RelativeLayout rl_sys, rl_chat;

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_msg;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        rl_sys = findViewById(R.id.rl_sys);
        rl_chat = findViewById(R.id.rl_chat);

        setHeadTitle("消息中心");

        rl_sys.setOnClickListener(this);
        rl_chat.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        if (v == rl_sys) {
            ToastUtils.showShort("系统消息");
        }
        if (v == rl_chat) {
            //          supportedConversation 定义会话列表支持显示的会话类型，及对应的会话类型是否聚合显示。
//          例如：supportedConversation.put(Conversation.ConversationType.PRIVATE.getName(), false)
//          非聚合式显示 private 类型的会话。
            Map<String, Boolean> typeMap = new HashMap<>();
            typeMap.put(Conversation.ConversationType.PRIVATE.getName(), false);
            RongIM.getInstance().startConversationList(this, typeMap);
        }
    }

    protected ProgressLayout findProgressLayout() {
        return null;
    }
}
